package com.finace.money.data;

import com.finace.money.common.Constant;
import com.finace.money.common.util.ParamUtil;
import com.finace.money.data.bean.AnalyseListBean;
import com.finace.money.data.bean.BaseBean;
import com.finace.money.data.http.ApiService;
import com.finace.money.presenter.contract.MainNewsContract;

import java.util.TreeMap;

import io.reactivex.Observable;

/**
 * Created by zhangpeng on 2018/1/27.
 */

public class MainNewsModel implements MainNewsContract.IMainNewsModel {

    private ApiService mApiService;

    public MainNewsModel(ApiService apiService) {
        this.mApiService = apiService;
    }

    @Override
    public Observable<BaseBean<AnalyseListBean>> getAnalyseList(String pagerSize, String pageNumber) {

        TreeMap<String, String> map = new TreeMap<>();
        map.put("pagerSize", pagerSize);
        map.put("pageNumber", pageNumber);
        return mApiService.getAnalyseList(Constant.analyseInterface, ParamUtil.getParma(map));
    }
}
